#coding:utf-8
from Marchines import NB
import feedparser

'''
docList=[]; classList = []; fullText =[]
ny = [];sf=[]
for i in range(1,26):
    print('email/spam/%d.txt' % i)
    wordList = NB.textParse(open('email/spam/%d.txt' % i,encoding='utf-8').read())
    docList.append(wordList)
    fullText.extend(wordList)
    ny.append(wordList)
    classList.append(1)
    print('email/ham/%d.txt' % i)
    wordList = NB.textParse(open('email/ham/%d.txt' % i,encoding='utf-8').read())
    docList.append(wordList)
    fullText.extend(wordList)
    sf.append(wordList)
    classList.append(0)
# print(fullText)
'''
# exit()

ny = feedparser.parse('http://newyork.craigslist.org/stp/index.rss')
sf = feedparser.parse('http://sfbay.craigslist.org/stp/index.rss')

# print(ny.encode('utf8'),sf.encode('utf8'))
print(u'%s'%(ny))
# NB.getTopWords(ny,sf)
